package com.tedu.oop.day2;
//this 关键字
//this 关键字
//this 关键字  调用构造函数
public class Test3_This{
    public static void main(String[] args) {
        Dog d=new Dog();

        System.out.println(d.name);
    }
}
class Dog{
    String name;

    public Dog() {
        this("金毛");
        System.out.println("无参构造");
    }

    public Dog(String name) {
        this.name=name;//(name)传进的参数赋值给---this.成员变量name
        System.out.println("全参构造");
    }
}
